home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / Metafont / Inputs / ec / exrllett.mf < prev    next >
Text File  |  1997-03-16  |  40KB  |  834 lines

  1. % exrllett.mf
  2. %
  3. % (c) Copyright 1995, 1996, 1997 J"org Knappen
  4. % (c) Copyright 1990, 1992 Norbert Schwarz
  5. %
  6. % This file is part of ecfonts version 1.0
  7. %
  8. % Please read the files 00readme.txt, 00inst.txt, 00error.txt, and
  9. % copyrite.txt for further information
  10. %
  11. % You find some documentation in ecdoc.tex (needs LaTeX2e)
  12. %
  13. % Content:
  14. %
  15. % roman lowercase letters a to z
  16.  
  17. version_check(1,0);  % |version_check| was introduced in dc1.3
  18.  
  19. ecchar "The letter a";
  20. beginchar("a",9u#,x_height#,0);
  21. bh#:=min(bar_height#,1.14x_height#-bar_height#); define_pixels(bh);
  22. italcorr 1/3[bh#,x_height#]*slant+.5stem#-serif_fit#-2u#;
  23. adjust_fit(0,serif_fit# if serifs: if hair#+.5stem#>1.5u#:-.25u# fi\\fi);
  24. pickup fine.nib; top y3r=h+vround 1.5oo;
  25. if serifs: pos1(flare,180); pos2(hair,180);
  26.  pos3(vair,90);  lft x1r=hround max(u,2.1u-.5flare); x3=.5w-.5u;
  27.  y1=min(bh+.5flare+2vair+2,.9[bh,h]-.5flare);
  28.  bulb(3,2,1);  % bulb
  29. else: pos1(5/7[vair,flare],95); x1l=good.x 1.5u; x1r:=good.x x1r;
  30.  pos3(1/8[vair,thin_join],90);
  31.  x3=.5w-.2u; top y1r=vround .82[bh,top y3r];
  32.  filldraw stroke term.e(3,1,left,.9,4); fi  % terminal
  33. pos4(stem,0); rt x4r=hround(w-2.5u+.5stem); y4=1/3[bh,h];
  34. pos5(stem,0); x5=x4; y5=max(.55bh,2vair);
  35. filldraw stroke super_arc.e(3,4)&z4e..z5e;  % arc and stem
  36. pos6(.3[thin_join,vair],90); x6=x4; bot y6=bh;
  37. pos7(hround(curve-2stem_corr),180);
  38. lft x7r=hround max(.5u,1.5u-.5curve); y7=1/3[top y8l,top y6r];
  39. pos8(vair,270); x8l=.5w-.75u; bot y8r=-oo;
  40. pos9(thin_join,360); z9l=z5l;
  41. (x,y8r)=whatever[z8l,z9l]; x8r:=max(x,x8-u);
  42. {{interim superness:=more_super;
  43.  filldraw stroke z9e{down}...z8e{left}...{up}z7e&super_arc.e(7,6)}}; % bowl
  44. if serifs: numeric shaved_stem; shaved_stem=hround(stem-3stem_corr);
  45.  if hair#+.5stem#>1.5u#: pickup tiny.nib;
  46.   pos5'(shaved_stem,0); rt x5'r=fine.rt x5r; y5'=y5;
  47.   pos10(shaved_stem,0); x10=x5'; y10=.2[.5tiny,bh];
  48.   pos11(shaved_stem,0); rt x11r=hround(w-.25u); bot y11=0;
  49.   pos12(shaved_stem,0); x11=x12; top y12=slab+eps;
  50.   filldraw z5'l---z10l...z11l{right}--z11r
  51.    --z12r{left}...z10r+.75(z12-z11)---z5'r--cycle;  % foot
  52.  else: pickup crisp.nib; pos5'(shaved_stem,0); rt x5'r=fine.rt x5r; y5'=y5;
  53.   pos10(shaved_stem,0); x10=x5'; y10=1/3bh;
  54.   pos11(.2[vair,stem],90); x11r=.5[x10r,x12r]; bot y11l=-vround .5oo;
  55.   pos12(hair,180); rt x12l=hround(w-.1u); y12=max(y10,y11+vair);
  56.   pos13(hair,180); x13=x12; top y13=max(vround .6bh,top y12);
  57.   (x',y11l)=whatever[z11r,z12r]; x11l:=max(x',x10);
  58.   filldraw stroke z5'e---z10e...z11e{right}...z12e---z13e; fi  % hook
  59. else: numeric shaved_stem; shaved_stem=hround(stem-stem_corr);
  60.  pickup tiny.nib; pos5'(shaved_stem,0); rt x5'r=fine.rt x5r; y5'=y5;
  61.  pos10(shaved_stem,0); x10=x5'; bot y10=0;
  62.  filldraw stroke z5'e--z10e; fi  % base of stem
  63. penlabels(1,2,3,4,5,6,7,8,9,10,11,12,13); endchar;
  64.  
  65. ecchar "The letter b";
  66. beginchar("b",10u#+serif_fit#,asc_height#,0);
  67. italcorr .5x_height#*slant+min(.5curve#-u#,-.25u#);
  68. adjust_fit(serif_fit#,0);
  69. pickup tiny.nib; pos1(stem',0); pos2(stem,0);
  70. pos0'(stem',0); pos0(stem,0); z0l=z0'l; x0'=x1; x0=x2;
  71. lft x1l=hround(2.5u-.5stem'); top y1=h;
  72. numeric edge; edge=rt x2r;
  73. pickup fine.nib; pos3(if hefty:thin_join else: hair fi,180);
  74. pos4(vair,90); pos5(curve,0); pos6(vair,-90); penpos7(x3l-x3r,-180);
  75. rt x3l=max(rt x3l-(lft x3r-tiny.lft x2l),1/3[rt x2,edge]);
  76. y3=1/8[bar_height,x_height];
  77. x4l=w-.5(w-serif_fit)+.5u; top y4r=x_height+oo;
  78. rt x5r=hround min(w-1.35u+.5curve,w-.6u); y5=.5x_height;
  79. x6l=x4l-.2u; bot y6r=-oo;
  80. x7=x3; y7=min(y3,y6+y4-y3+.6vair);
  81. (x,y4r)=whatever[z3l,z4l]; x4r:=min(x,.5[x4,x5r]);
  82. (x',y6r)=whatever[z7l,z6l]; x6r:=min(x',.5[x6,x5r]);
  83. filldraw stroke z3e{up}...pulled_arc.e(4,5)&pulled_arc.e(5,6)...{up}z7e; % bowl
  84. y0=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{right}z4l));
  85. y2=ypart(((edge,h)--(edge,0))intersectionpoint(z6l{left}...{up}z7l));
  86. pickup tiny.nib; filldraw stroke z1e--z0'e--z0e--z2e;  % stem
  87. pickup crisp.nib; pos8(hair,0); pos7'(stem,0);
  88. z7'=z2; x8l=x7'l; bot y8=0;
  89. filldraw stroke z7'e--z8e;  % point
  90. if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop); fi  % upper serif
  91. penlabels(0,1,2,3,4,5,6,7,8); endchar;
  92.  
  93. ecchar "The letter c";
  94. beginchar("c",8u#,x_height#,0);
  95. italcorr x_height#*slant-.2u#;
  96. adjust_fit(if monospace: .5u#,.5u# else: 0,0 fi);
  97. pickup fine.nib; pos2(vair',90); pos4(vair',270);
  98. x2=x4=.5(w+u); top y2r=vround(h+1.5oo); bot y4r=-oo;
  99. pos3(curve,180); lft x3r=hround max(.6u,1.35u-.5curve); y3=.5h;
  100. if serifs: pos1(hair,0); pos0(flare,0);
  101.  y1=min(bar_height+.5flare+2vair'+2,.9[bar_height,h]-.5flare);
  102.  rt x1r=hround(w-.7u); bulb(2,1,0);  % bulb
  103.  pos5(hair,0); rt x5r=hround(w-.5u);
  104.  y5=max(good.y(.5bar_height-.9),y4l+vair');
  105.  (x,y4l)=whatever[z4r,z5l]; x4l:=min(x,x4l+.5u);
  106.  filldraw stroke pulled_super_arc.e(2,3)(.7superpull)
  107.   & pulled_super_arc.e(3,4)(.5superpull)
  108.   ..tension .9 and 1..{x5-x4,5(y5-y4)}z5e;  % arc and lower terminal
  109. else: pos1(4/7[vair',flare],80);
  110.  rt x1r=hround(w-.6u); top y1r=vround .82[bar_height,top y2r];
  111.  filldraw stroke term.e(2,1,right,.8,4);  % upper terminal
  112.  pos5(.6[vair',flare],275); rt x5r=hround(w-.5u);
  113.  y5r=good.y(y5r+1/3bar_height-y5); y5l:=good.y y5l; x5l:=good.x x5l;
  114.  forsuffixes e=l,r: path p.e; p.e=z4e{right}..tension .9 and 1..z5e;
  115.   if angle direction 1 of p.e>75:
  116.    p.e:=z4e{right}..tension atleast.9 and 1..{dir 75}z5e; fi endfor
  117.  filldraw stroke pulled_super_arc.e(2,3)(.7superpull)
  118.   & pulled_super_arc.e(3,4)(.5superpull) & p.e; fi  % arc and lower terminal
  119. penlabels(0,1,2,3,4,5); endchar;
  120.  
  121. ecchar "The letter d";
  122. beginchar("d",10u#+serif_fit#,asc_height#,0);
  123. italcorr asc_height#*slant-serif_fit#+.5stem#-2u#;
  124. adjust_fit(0,serif_fit#);
  125. pickup tiny.nib; pos1(stem',0); pos2(stem,0);
  126. pos0'(stem',0); pos0(stem,0); z0r=z0'r; x0'=x1; x0=x2;
  127. rt x1r=hround(w-2.5u+.5stem'); top y1=h;
  128. numeric edge; edge=lft x2l;
  129. pickup fine.nib; pos3(if hefty:thin_join else: hair fi,0);
  130. pos4(vair,90); pos5(curve,180); pos6(vair,270); penpos7(x3r-x3l,360);
  131. lft x3l=min(lft x3l-(rt x3r-tiny.rt x2r),1/3[lft x2,edge]);
  132. y3=1/8[bar_height,x_height];
  133. x4l=.5(w-serif_fit)-.3u; top y4r=x_height+oo;
  134. lft x5r=hround max(1.35u-.5curve,.6u); y5=.5x_height;
  135. x6l=x4l-.2u; bot y6r=-oo;
  136. x7=x3; y7=min(y3,y6+y4-y3+.6vair);
  137. (x,y4r)=whatever[z3l,z4l]; x4r:=max(x,.5[x5r,x4]);
  138. (x',y6r)=whatever[z7l,z6l]; x6r:=max(x',.5[x5r,x6]);
  139. filldraw stroke z3e{up}...pulled_arc.e(4,5)
  140.  & pulled_arc.e(5,6)...{up}z7e; % bowl
  141. y0=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{left}z4l));
  142. pickup tiny.nib; bot y2=if serifs:-min(oo,serif_drop) else: 0 fi;
  143. filldraw stroke z1e--z0'e--z0e--z2e;  % stem
  144. if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop);  % upper serif
  145.  sloped_serif.r(2,0,b,1/3,jut,min(oo,serif_drop)); fi  % lower serif
  146. penlabels(0,1,2,3,4,5,6,7); endchar;
  147.  
  148. ecchar "The letter e";
  149. beginchar("e",7.25u#+max(.75u#,.5curve#),x_height#,0);
  150. italcorr .5[bar_height#,x_height#]*slant+.5min(curve#-1.5u#,0);
  151. adjust_fit(if monospace: .25u#,.5u# else: 0,0 fi);
  152. numeric left_curve,right_curve;
  153. left_curve=right_curve+6stem_corr=curve if not serifs: -3stem_corr fi;
  154. if right_curve<tiny.breadth: right_curve:=tiny.breadth; fi
  155. if left_curve<tiny.breadth: left_curve:=tiny.breadth; fi
  156. pickup tiny.nib; pos1(right_curve,0);
  157. pos2(vair,90); pos3(left_curve,180);
  158. y1=good.y bar_height; top y2r=h+vround 1.5oo; y0l=bot y1;
  159. rt x1r=hround min(w-.5u,w-u+.5right_curve);
  160. lft x3r=hround max(.5u,1.25u-.5left_curve); x2=.5w+.25u;
  161. {{interim superness:=more_super;
  162.  filldraw stroke super_arc.e(1,2)}};  % right bowl
  163. y3=.5[y2,y4]; bot y4r=-oo; x4=x2+.25u;
  164. if serifs: pos4(vair',270); pos5(hair,360);
  165.  y5=max(good.y(.5bar_height-.9),y4l+vair); x5r=x1r;
  166.  (x,y4l)=whatever[z4r,z5]; x4l:=min(x,x4l+.5u);
  167.  filldraw stroke pulled_arc.e(2,3) & pulled_arc.e(3,4)
  168.   ...{x5-x4,5(y5-y4)}z5e; % left bowl, arc, and terminal
  169. else: pos4(vair,270);
  170.  filldraw stroke super_arc.e(2,3) & super_arc.e(3,4);  % left bowl and arc
  171.  pickup fine.nib; pos4'(vair,270); z4=z4';
  172.  pos5(.5[vair,flare],275); rt x5r=hround(w-.6u);
  173.  y5r=good.y(y5r+1/3bar_height-y5); y5l:=good.y y5l; x5l:=good.x x5l;
  174.  filldraw stroke term.e(4',5,right,1,4); fi  % terminal
  175. path testpath; testpath=super_arc.r(2,3) & super_arc.r(3,4);
  176. y1'r=y0r=y0l+.6[thin_join,vair]; y1'l=y0l; x1'l=x1'r=x1;
  177. forsuffixes $=l,r:
  178.  x0$=xpart(((0,y0$)--(x1,y0$)) intersectionpoint testpath); endfor
  179. fill stroke z0e--z1'e;  % crossbar
  180. penlabels(0,1,2,3,4,5); endchar;
  181.  
  182. ecchar "The letter f";
  183. beginchar("f",5.5u#,asc_height#,0);
  184. italcorr asc_height#*slant+if serifs:flare#-.25u# else: 1.25u# fi;
  185. adjust_fit(stem_shift#,if monospace: .5u# else:-stem_shift# fi);
  186. pickup tiny.nib; pos1(stem',0); lft x1l=hround(2.5u-.5stem');
  187. pickup fine.nib; numeric bulb_diam;
  188. if serifs: bulb_diam=hround .8[stem,flare];
  189.  pos2(bulb_diam,0); y2+.5bulb_diam=.9[x_height,h+oo];
  190.  if monospace: rt x2r=hround(w-.5u)+1 else: lft x2l=hround(w-.75u+.5) fi;
  191. else: pos2(5/7[vair,flare],90); top y2r=h;
  192.  rt x2=hround(if monospace:w-.5u else:w+.75u fi); fi
  193. f_stroke(1,2,a,b,c,jut,if not monospace:1.25fi\\ jut); % stem, terminal, serif
  194. pickup crisp.nib; top y3r=top y4r=x_height; lft x3=hround .5u-1;
  195. pos3(bar,90); pos4(bar,90);
  196. rt x4=hround(w-if monospace:.75u+1 else:1/3u fi);
  197. filldraw stroke z3e--z4e;  % bar
  198. penlabels(1,2,3,4); endchar;
  199.  
  200. iff not variant_g: ecchar "The letter g";
  201. beginchar("g",9u#,x_height#,desc_depth#);
  202. italcorr x_height#*slant+.25u#;
  203. adjust_fit(0,0);
  204. numeric light_vair,light_curve,loop_top,loop_side;
  205. light_vair=Vround(.5[thin_join,vair]+vair_corr);
  206. light_curve=max(fine.breadth,hround(curve-3stem_corr));
  207. loop_top=Vround .77[vair,fudged.stem];
  208. loop_side=hround .64[vair,fudged.stem];
  209. pickup fine.nib; pos1(light_vair,90);
  210. pos2(light_curve,180); pos3(light_vair,270);
  211. pos4(light_curve,360); pos11(loop_top,90);
  212. y11r=good.y(y11r+.15bar_height-y11); x1=x3=.5[x2,x4]; y2=y4=.5[y1,y3];
  213. lft x2r=hround(1.75u-.5light_curve); rt x4r=hround(w-2.75u+.5light_curve);
  214. top y1r=h+oo; y3r=good.y(y3r+.27[top y11r,bot y1l]-y3);
  215. filldraw stroke pulled_arc.e(1,2) & pulled_arc.e(2,3);  % left half of bowl
  216. filldraw stroke pulled_arc.e(3,4) & pulled_arc.e(4,1);  % right half of bowl
  217. x0=superness[x1r,x4r]; y0=superness[y4r,y1r];  % NE point on the super bowl
  218. x8'=superness[x3r,x2r]; y8'=superness[y2r,y3r];  % SW point on the super bowl
  219. x8''=superness[x3,x2]; y8''=superness[y2,y3];
  220. pos0(thin_join,angle(z0-z8')+90);
  221. pos8(thin_join,angle(z0-z8')-90); z8=.618[z8',z8''];
  222. if serifs: pos5(vair,90);
  223.  pos6(hair,0); pos7(.5[hair,flare],0); x5=.75[x0,x6]; top y5r=h+o;
  224.  rt x6r=hround(w-.25u); y6+(.5[hair,flare])/2=.95[bar_height,h]+oo;
  225.  filldraw stroke z0e..{right}z5e; bulb(5,6,7);  % ear
  226. else: pos5(vair',100); top y5r=h+oo;
  227.  rt x5l=hround(w-.25u); y5l:=good.y y5l;
  228.  filldraw z0l{z5-z0}..z5l--z5r{left}..{curl 1}z0r--cycle; fi  % ear
  229. pos10(loop_top,90); x10=x8+.75u; y10=y11;
  230. pos12(loop_side,0); pos13(light_vair,-90);
  231. pos14(loop_side,-180); pos10'(.5[thin_join,vair],-270);
  232. rt x12r=hround max(w-1.25u+.5loop_side,w-.5u); y12=y14=.5[y11,y13];
  233. x11=x13=max(.5w,x10+eps); bot y13r=-d-oo-1; x14=w-x12; z10'l=z10l;
  234. filldraw stroke z8e{z8-z0}..z10e---z11e;  % link
  235. filldraw stroke {{interim superness:=hein_super; super_arc.e(11,12)}}
  236.  & super_arc.e(12,13) & super_arc.e(13,14) & super_arc.e(14,10');  % loop
  237. penlabels(0,1,2,3,4,5,6,7,8,10,11,12,13,14); labels(8',8''); endchar;
  238.  
  239. iff variant_g: ecchar "Variant letter g";
  240. beginchar("g",10u#+serif_fit#,x_height#,desc_depth#);
  241. italcorr x_height#*slant-serif_fit#+.5stem#-2u# if serifs:+.5u# fi;
  242. adjust_fit(0,serif_fit# if serifs: -.5u# fi);
  243. pickup tiny.nib; pos1(stem',0); pos2(stem,0);
  244. pos0'(stem',0); pos0(stem,0); z0r=z0'r; x0'=x1; x0=x2;
  245. rt x1r=hround(w-2.5u+.5stem');
  246. numeric edge; edge=lft x2l;
  247. path edge_path; edge_path=(edge,h)--(edge,0);
  248. pickup fine.nib; pos3(if hefty:thin_join else: hair fi,0);
  249. pos4(vair,90); pos5(curve,180); pos6(vair,270); penpos7(x3r-x3l,360);
  250. lft x3l=min(lft x3l-(rt x3r-tiny.rt x2r),2/3[lft x2,edge]); y3=bar_height;
  251. x4l=.5(w-serif_fit)-.3u; top y4r=x_height+oo;
  252. lft x5r=hround max(1.35u-.5curve,.6u); y5=.5x_height;
  253. x6l=x4l-.2u; bot y6r=vround 1/3vair;
  254. lft x7l=edge; y7=min(y3,y6+y4-y3+.6vair);
  255. (x,y4r)=whatever[z3l,z4l]; x4r:=max(x,.5[x5r,x4]);
  256. (x',y6r)=whatever[z7l,z6l]; x6r:=max(x',.5[x5r,x6]);
  257. filldraw stroke z3e{up}...{left}z4e&super_arc.e(4,5)
  258.  &super_arc.e(5,6)&z6e{right}...{up}z7e;  % bowl
  259. y1=ypart(edge_path intersectionpoint(z3l{up}...{left}z4l));
  260. y0=ypart(edge_path intersectionpoint(z7l{down}...{left}z6l));
  261. pickup tiny.nib; bot y2=if serifs: -.25d else: 0 fi;
  262. filldraw stroke z1e--z0'e--z0e--z2e;  % stem
  263. pickup crisp.nib;
  264. pos8(hround(hair-stem_corr),0); pos7'(stem',0);
  265. z7'=z1; x8r=x7'r; top y8=h+oo;
  266. filldraw stroke z7'e--z8e;  % point
  267. if serifs: pickup tiny.nib;
  268.  pos9(vair,-90); x9=.5[x2,x10]; bot y9r=-d-o-1;
  269.  pos10(hair,-180); lft x10r=hround u; y10=-.75d+.5flare;
  270.  pos11(flare,-180); z11r=z10r;
  271.  bulb(9,10,11); filldraw stroke super_arc.e(2,9);  % tail
  272. else: pickup fine.nib; pos2'(stem,0); z2'=z2;
  273.  z2''r=z2'r; z2''=z2'; z2''l=(x2'l,0);
  274.  pos9(vair,-90); x9=4.5u; bot y9r=-d-o-1;
  275.  pos10(.5[vair,flare],-90); lft x10=hround 1.25u;
  276.  y10r=good.y -5/6d; y10l:=good.y y10l;
  277.  filldraw stroke z2'e..z2''e&super_arc.e(2'',9)
  278.   & term.e(9,10,left,.9,4); fi  % tail
  279. penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;
  280.  
  281. ecchar "The letter h";
  282. beginchar("h",10u#,asc_height#,0);
  283. italcorr .5[bar_height#,x_height#]*slant-serif_fit#+.5stem#-2u#;
  284. adjust_fit(serif_fit#+stem_shift#,serif_fit#-stem_shift#);
  285. pickup tiny.nib; pos1(stem,0); pos2(stem,0);
  286. pos1'(stem',0); pos2'(stem',0); pos3(stem,0);
  287. lft x1l=hround(2.5u-.5stem); x1l=x1'l=x2l=x2'l; x3=w-x1;
  288. top y1=h; bot y2=0; y1=y1'; y2=y2';
  289. filldraw stroke z1'e--z2'e;  % left stem
  290. h_stroke(2,a,3,4);  % arch and right stem
  291. if serifs: sloped_serif.l(1',2',b,1/3,jut,serif_drop); % upper left serif
  292.  numeric inner_jut; pickup tiny.nib;
  293.  if rt x2r+jut+.5u+1<=lft x4l-jut: inner_jut=jut;
  294.  else: rt x2r+jut+.5u+1=lft x4l-inner_jut; fi
  295.  dish_serif(2,1,c,1/3,jut,d,1/3,jut); % lower left serif
  296.  dish_serif(4,3,e,1/3,inner_jut,f,1/3,jut); fi % lower right serif
  297. penlabels(1,2,3,4); endchar;
  298.  
  299. ecchar "The letter i";
  300. beginchar("i",5u#,min(asc_height#,10/7x_height#+.5idot_diam#),0);
  301. italcorr h#*slant-serif_fit# + .5idot_diam# -2u#;
  302. adjust_fit(serif_fit#+stem_shift# if monospace:+.25u#fi,serif_fit#-stem_shift#);
  303. pickup tiny.nib; pos1(stem',0); pos2(stem',0);
  304. if odd(w-stem'): change_width; fi
  305. lft x1l=hround(.5w-.5stem'); x1=x2;
  306. top y1=x_height if serifs: +min(oo,serif_drop) fi; bot y2=0;
  307. filldraw stroke z1e--z2e;  % stem
  308. pos3(idot_diam,0); pos4(idot_diam,90);
  309. if serifs: x3r=max(x1r,hround(x1+.5idot_diam-.2jut)-.5tiny)
  310. else: x3=x1-.5 fi;
  311. top y4r=h+1;
  312. if bot y4l-top y1<slab: y4l:=min(y4r-eps,y1+tiny+slab); fi
  313. x3=x4; y3=.5[y4l,y4r]; dot(3,4);  % dot
  314. if serifs or monospace:
  315.  sloped_serif.l(1,2,a,1/3,.95jut,serif_drop);  % upper serif
  316. fi
  317. if serifs: dish_serif(2,1,b,1/3,jut,c,1/3,.9jut); fi  % lower serif
  318. penlabels(1,2,3,4); endchar;
  319.  
  320. ecchar "The letter j";
  321. beginchar("j",5.5u#,min(asc_height#,10/7x_height#+.5idot_diam#),desc_depth#);
  322. italcorr h#*slant-serif_fit#+.5stem#-2u#;
  323. adjust_fit(serif_fit#+2stem_shift# if monospace:+\\.5u# fi,
  324.  serif_fit#-2stem_shift# if monospace:-.5u# fi);
  325. pickup tiny.nib; pos1(stem',0); pos2(stem',0);
  326. rt x1r=hround(.5w+.25u+.5stem'); x1=x2;
  327. top y1=x_height if serifs: +min(oo,serif_drop) fi; bot y2=-1/3d;
  328. filldraw stroke z1e--z2e;  % stem
  329. pos3(idot_diam,0); pos4(idot_diam,90);
  330. x3r=x1r; top y4r=h+1;
  331. if bot y4l-top y1<slab: y4l:=min(y4r-eps,y1+tiny+slab); fi
  332. x3=x4; y3=.5[y4l,y4r]; dot(3,4);  % dot
  333. if serifs: sloped_serif.l(1,2,a,1/3,1.1jut,serif_drop);  % upper serif
  334.  pickup tiny.nib; pos5(vair,-90); pos6(hair,-180); pos7(flare,-180);
  335.  x5=.5[x2,x6r]; bot y5r=-d-oo; y6-.5flare=-.88d;
  336.  if monospace: lft x6r=0 else: z6r=z7r; rt x7l=floor .75u fi;
  337.  (x,y5r)=whatever[z5l,z2l]; x5r:=max(x,.5[x6r,x5]);
  338.  filldraw stroke z2e{down}...z5e{left};  bulb(5,6,7); % arc and bulb
  339. else: pickup fine.nib; pos2'(stem',0); z2'=z2;
  340.  pos6(.2[vair,stem'],-90); pos7(vair,-90);
  341.  lft x7r=hround -.75u; bot y7r=vround 5/6(-d-oo);
  342.  (x,y7l)=whatever[z7r,z3]; x7l:=x;
  343.  z5r=z2'r; (x2'l,y5l)=whatever[z7l,z5r]; x5l=x2'l; y5=y5r;
  344.  x6r=.5[x7r,x5r]; x6l:=.5[x7l,x5l]; bot y6r=-d-oo;
  345.  filldraw stroke z2'e..{down}z5e & super_arc.e(5,6)
  346.   & z6e{left}..z7e; fi  % arc and terminal
  347. penlabels(1,2,3,4,5,6,7); endchar;
  348.  
  349. ecchar "The letter k";
  350. beginchar("k",9.5u#,asc_height#,0);
  351. italcorr x_height#*slant-.2u#;
  352. adjust_fit(serif_fit#,serif_fit#); pickup tiny.nib;
  353. numeric right_jut,stem[],alpha[];
  354. stem1=max(tiny.breadth,hround(fudged.stem-stem_corr));
  355. stem2=max(tiny.breadth,hround(fudged.stem-2stem_corr));
  356. stem3=max(tiny.breadth,hround(fudged.hair if hefty:-\\4stem_corr fi));
  357. stem4=max(tiny.breadth,hround(fudged.stem-3stem_corr));
  358. if serifs: right_jut=.6jut; else: right_jut=.4tiny; fi
  359. pos1(stem1,0); pos2(stem2,0); top y1=h; bot y2=0;
  360. lft x1l=lft x2l=hround(2.5u-.5stem1);
  361. top y3=x_height; rt x3r=hround(r-letter_fit-.7u-right_jut)+eps;
  362. bot y6=0; rt x6r=hround(r-letter_fit-.3u-right_jut)+eps;
  363. x4=x11=x1; y4=.7bar_height; y11=y3;
  364. alpha1=diag_ratio(1,.5(stem3-tiny),y3-y4,x3r-x4);
  365. alpha2=diag_ratio(1,.5(stem4-tiny),y11-y6,x6r-x1);
  366. penpos3(alpha1*(stem3-tiny),0); penpos4(whatever,-90);
  367. z5=.5[z5l,z5r]; penpos6(alpha2*(stem4-tiny),0);
  368. forsuffixes $=l,r: y3'$=x_height; y6'$=0; z4$=z3'$+whatever*(z3-z4);
  369.  z5$=z6'$+whatever*(z11-z6)=whatever[z3,z4]; endfor
  370. z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
  371. % we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\]
  372. z6'r=z6r+penoffset z11-z6 of currentpen+whatever*(z11-z6);
  373. z6'l=z6l+penoffset z6-z11 of currentpen+whatever*(z11-z6);
  374. fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle;  % upper diagonal
  375. fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle;  % lower diagonal
  376. pos0(stem1,0); pos0'(stem2,0); y0=y0'; x0=x1; x0'=x2;
  377. rt z0r=whatever[z3,z4]; filldraw stroke z1e..z0e--z0'e..z2e; % stem
  378. if serifs: numeric inner_jut;
  379.  if rt x2r+jut+.5u+1<=lft x6l-jut: inner_jut=jut;
  380.  else: rt x2r+inner_jut+.5u+1=lft x6l-inner_jut; fi
  381.  sloped_serif.l(1,0,a,1/3,jut,serif_drop); % upper stem serif
  382.  dish_serif(2,0',b,1/3,jut,c,1/3,inner_jut);  % lower stem serif
  383.  dish_serif(3,4,d,2/3,1.4jut,e,1/2,right_jut)(dark); % upper diagonal serif
  384.  dish_serif(6,5,f,1/2,inner_jut,g,1/3,right_jut)(dark);fi % lower diagonal serif
  385. penlabels(0,1,2,3,4,5,6,11); endchar;
  386.  
  387. ecchar "The letter l";
  388. beginchar("l",5u#,asc_height#,0); l_width#:=5u#+2serif_fit#;
  389. italcorr asc_height#*slant-serif_fit#+.5stem#-2u#;
  390. adjust_fit(serif_fit#+stem_shift#,serif_fit#-stem_shift#);
  391. pickup tiny.nib; pos1(stem',0); pos2(stem',0);
  392. if odd(w-stem'): change_width; fi
  393. lft x1l=hround(.5w-.5stem'); x1=x2; top y1=h; bot y2=0;
  394. filldraw stroke z1e--z2e;  % stem
  395. if serifs or monospace:
  396.  sloped_serif.l(1,2,a,1/3,jut,serif_drop);  % upper serif
  397. fi
  398. if serifs: dish_serif(2,1,b,1/3,jut,c,1/3,jut); fi  % lower serif
  399. penlabels(1,2); endchar;
  400.  
  401. ecchar "The letter m";
  402. beginchar("m",15u#,x_height#,0);
  403. italcorr .5[bar_height#,x_height#]*slant-serif_fit#+.5stem#-2u#;
  404. adjust_fit(serif_fit#+stem_shift#,serif_fit#-stem_shift#);
  405. numeric shaved_stem; shaved_stem=hround(mfudged.stem-2stem_corr);
  406. pickup tiny.nib; pos1(mfudged.stem,0); pos2(mfudged.stem,0);
  407. pos1'(shaved_stem,0); pos2'(shaved_stem,0);
  408. pos3(mfudged.stem,0); pos5(mfudged.stem,0);
  409. lft x1l=hround(2.5u-.5stem); x1l=x1'l=x2l=x2'l; % stem, sic
  410. lft x3l=hround(.5w-.5mfudged.stem); x5-x3=x3-x1;
  411. if not monospace: r:=hround(x5+x1)+r-w; fi  % change width for better fit
  412. top y1=h+min(oo,serif_drop); bot y2=0; y1=y1'; y2=y2';
  413. filldraw stroke z1'e--z2'e;  % left stem
  414. h_stroke(2,a,3,4);  % left arch and middle stem
  415. h_stroke(4,b,5,6);  % right arch and right stem
  416. if serifs: sloped_serif.l(1',2',c,1/3,jut,serif_drop); % upper left serif
  417.  numeric inner_jut; pickup tiny.nib;
  418.  if rt x2r+jut+.5u+1<=lft x4l-jut: inner_jut=jut;
  419.  else: rt x2r+jut+.5u+1=lft x4l-inner_jut; fi
  420.  dish_serif(2,1,d,1/3,jut,e,1/3,jut); % lower left serif
  421.  dish_serif(4,3,f,1/3,inner_jut,g,1/3,jut); % lower middle serif
  422.  dish_serif(6,5,h,1/3,inner_jut,i,1/3,jut); fi % lower right serif
  423. penlabels(1,2,3,4,5,6); endchar;
  424.  
  425. ecchar "The letter n";
  426. beginchar("n",10u#,x_height#,0);
  427. italcorr .5[bar_height#,x_height#]*slant-serif_fit#+.5stem#-2u#;
  428. adjust_fit(serif_fit#+stem_shift#,serif_fit#-stem_shift#);
  429. pickup tiny.nib; pos1(stem,0); pos2(stem,0);
  430. numeric shaved_stem; shaved_stem=hround(stem-2stem_corr);
  431. pos1'(shaved_stem,0); pos2'(shaved_stem,0); pos3(stem,0);
  432. lft x1l=hround(2.5u-.5stem); x1l=x1'l=x2l=x2'l; x3=w-x1;
  433. top y1=h+min(oo,serif_drop); bot y2=0; y1=y1'; y2=y2';
  434. filldraw stroke z1'e--z2'e;  % left stem
  435. h_stroke(2,a,3,4);  % arch and right stem
  436. if serifs: sloped_serif.l(1',2',b,1/3,jut,serif_drop); % upper left serif
  437.  numeric inner_jut; pickup tiny.nib;
  438.  if rt x2r+jut+.5u+1<=lft x4l-jut: inner_jut=jut;
  439.  else: rt x2r+jut+.5u+1=lft x4l-inner_jut; fi
  440.  dish_serif(2,1,c,1/3,jut,d,1/3,jut); % lower left serif
  441.  dish_serif(4,3,e,1/3,inner_jut,f,1/3,jut); fi % lower right serif
  442. penlabels(1,2,3,4); endchar;
  443.  
  444. ecchar "The letter o";
  445. beginchar("o",9u#,x_height#,0);
  446. italcorr .7x_height#*slant;
  447. adjust_fit(if monospace: .5u#,.5u# else: 0,0 fi);
  448. penpos1(vair,90); penpos3(vair',-90);
  449. penpos2(curve,180); penpos4(curve,0);
  450. x2r=hround max(.5u,1.25u-.5curve);
  451. x4r=w-x2r; x1=x3=.5w; y1r=h+vround 1.5oo; y3r=-oo;
  452. y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
  453. penstroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
  454.  & pulled_arc.e(3,4) & pulled_arc.e(4,1) & cycle;  % bowl
  455. penlabels(1,2,3,4); endchar;
  456.  
  457. ecchar "The letter p";
  458. beginchar("p",10u#+serif_fit#,x_height#,desc_depth#);
  459. italcorr .5x_height#*slant+min(.5curve#-.85u#,-.1u#);
  460. adjust_fit(serif_fit#,0);
  461. pickup tiny.nib; pos1(stem',0); pos2(stem,0);
  462. pos0'(stem',0); pos0(stem,0); z0l=z0'l; x0'=x1; x0=x2;
  463. lft x1l=hround(2.5u-.5stem'); top y1=h if serifs: +min(oo,serif_drop) fi;
  464. numeric edge; edge=rt x2r;
  465. pickup fine.nib; pos3(if hefty:thin_join else: hair fi,180);
  466. pos4(vair',90); pos5(curve,0); pos6(vair,-90); penpos7(x3l-x3r,-180);
  467. rt x3l=max(rt x3l-(lft x3r-tiny.lft x2l), 1/3[rt x2,edge]);
  468. y3=1/8[bar_height,x_height];
  469. x4l=w-.5(w-serif_fit)+.5u; top y4r=x_height+oo;
  470. rt x5r=hround min(w-1.35u+.5curve,w-.6u); y5=.5x_height;
  471. x6l=x4l-.2u; bot y6r=-oo;
  472. x7=x3; y7=min(y3,y6+y4-y3+.6vair);
  473. (x,y4r)=whatever[z3l,z4l]; x4r:=min(x,.5[x5r,x4]);
  474. (x',y6r)=whatever[z7l,z6l]; x6r:=min(x',.5[x5r,x6]);
  475. filldraw stroke z3e{up}...{right}z4e&super_arc.e(4,5)
  476.  &super_arc.e(5,6)&z6e{left}...{up}z7e;  % bowl
  477. y0=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{right}z4l));
  478. pickup tiny.nib; bot y2=-d;
  479. filldraw stroke z1e--z0'e--z0e--z2e;  % stem
  480. pickup crisp.nib; pos8(hair,0); pos7'(stem,0);
  481. z7'=z2; x8l=x7'l; bot y8=0;
  482. filldraw stroke z7'e--z8e;  % point
  483. if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop);  % upper serif
  484.  dish_serif(2,0,b,1/3,jut,c,1/3,jut); fi  % lower serif
  485. penlabels(0,1,2,3,4,5,6,7,8); endchar;
  486.  
  487. ecchar "The letter q";
  488. beginchar("q",10u#+serif_fit#,x_height#,desc_depth#);
  489. italcorr x_height#*slant-serif_fit#+.5stem#-2u# if serifs:+.5u# fi;
  490. adjust_fit(0,serif_fit# if serifs: -.5u# fi);
  491. pickup tiny.nib; pos1(stem',0); pos2(stem,0);
  492. pos0'(stem',0); pos0(stem,0); z0r=z0'r; x0'=x1; x0=x2;
  493. rt x1r=hround(w-2.5u+.5stem');
  494. numeric edge; edge=lft x2l;
  495. pickup fine.nib; pos3(if hefty:thin_join else: hair fi,0);
  496. pos4(vair',90); pos5(curve,180); pos6(vair,270); penpos7(x3r-x3l,360);
  497. lft x3l=min(lft x3l-(rt x3r-tiny.rt x2r),2/3[lft x2,edge]); y3=bar_height;
  498. x4l=.5(w-serif_fit)-.3u; top y4r=x_height+oo;
  499. lft x5r=hround max(1.35u-.5curve,.6u); y5=.5x_height;
  500. x6l=x4l-.2u; bot y6r=-oo; y7=min(y3,y6+y4-y3+.6vair);
  501. lft x7l=min(lft x7l-(rt x7r-tiny.rt x2r),1/3[lft x2,edge]);
  502. (x,y4r)=whatever[z3l,z4l]; x4r:=max(x,.5[x5r,x4]);
  503. (x',y6r)=whatever[z7l,z6l]; x6r:=max(x',.5[x5r,x6]);
  504. filldraw stroke z3e{up}...{left}z4e&super_arc.e(4,5)
  505.  &super_arc.e(5,6)&z6e{right}...{up}z7e;  % bowl
  506. y1=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{left}z4l));
  507. y0=ypart(((edge,h)--(edge,0))intersectionpoint(z6l{right}...{up}z7l));
  508. pickup tiny.nib; bot y2=-d;
  509. filldraw stroke z1e--z0'e--z0e--z2e;  % stem
  510. pickup crisp.nib;
  511. pos8(hround(hair-stem_corr),0); pos7'(stem',0);
  512. z7'=z1; x8r=x7'r; top y8=h+oo;
  513. filldraw stroke z7'e--z8e;  % point
  514. if serifs: dish_serif(2,0,b,1/3,jut,c,1/3,jut); fi  % lower serif
  515. penlabels(0,1,2,3,4,5,6,7,8); endchar;
  516.  
  517. ecchar "The letter r";
  518. numeric r_flare#; r_flare#=.75[if serifs: stem# else: vair# fi,flare#];
  519. define_whole_blacker_pixels(r_flare);
  520. beginchar("r",if serifs:max(7u#,5.5u#+r_flare#) else:6.5u# fi,x_height#,0);
  521. italcorr x_height#*slant if not serifs: +.25u# fi;
  522. adjust_fit(serif_fit#,0);
  523. pickup fine.nib; top y4r=h+oo;
  524. if serifs: pos4(vair,90); pos5(hair,0);
  525.  x4=w-max(1.75u,.25u+r_flare);
  526.  rt x5r=hround(w-.5u+.5); y5+.5r_flare=.9[bar_height,h]+oo;
  527.  pos6(r_flare,0); bulb(4,5,6);  % bulb
  528. else: pos4(r_flare,90); rt x4=hround(w-.25u); fi
  529. pos3(thin_join,180); rt x3l=hround(2.5u-.5stem')+stem'; top y3=bar_height;
  530. filldraw stroke z3e{up}...{right}z4e;  % arc
  531. pickup tiny.nib; pos0(stem',0); pos2(stem',0);
  532. pos1(hround(stem-3stem_corr),0); top y1=h+min(oo,serif_drop);
  533. pos0'(hround(stem-3stem_corr),0); y0=y0'=y3; x1l=x0l=x0'l=x2l;
  534. lft x1l=hround(2.5u-.5stem'); bot y2=0;
  535. filldraw stroke z1e--z0'e--z0e--z2e;  % stem
  536. if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop);  % upper serif
  537.  dish_serif(2,0,b,1/3,jut,c,1/3,1.25jut); fi  % lower serif
  538. penlabels(1,2,3,4,5,6); endchar;
  539.  
  540. ecchar "The letter s";
  541. beginchar("s",7.1u#,x_height#,0);
  542. italcorr x_height#*slant-if serifs:.55u# else:.3u# fi;
  543. adjust_fit(if monospace: .5u#,.4u# else: 0,if serifs:0 else:-.2u# fi fi);
  544. numeric theta; theta=90-angle(40u,h); slope:=-h/40u;  % angle at middle
  545. numeric s_slab; s_slab=if serifs:vair else:Vround .1[vair,stem] fi;
  546. numeric ess'; ess'=max(fine.breadth,ess);
  547. pickup fine.nib; pos2(max(fine.breadth,s_slab-vround vair_corr),-100);
  548. pos0(ess',theta); pos7(s_slab,-90); x2l=x0=x7=.5w;
  549. top y2l=h+vround 1.5oo; bot y7r=-oo;
  550. y0-.5ess'=y7l+if serifs:.54 else: .52 fi\\(y2r-y7l-ess');
  551. lft x3l=hround .6u; rt x6r=hround(w-.6u);
  552. x3r-x3l=x6r-x6l=hround .5[s_slab,ess']-fine;
  553. ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r;
  554. ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r;
  555. interim superness:=more_super;
  556. filldraw stroke super_arc.e(2,3) & z3e{down}
  557.  ..z4e---z5e..z6e{down} & super_arc.e(6,7);  % main stroke
  558. if serifs: pos1(hair,180); pos8(hair,180);
  559.  rt x1l=hround(w-1.05u); lft x8r=hround .6u;
  560.  bot y1=min(bot y2r,vround 1/5[top y5r,h]);
  561.  top y8=max(top y7l,vround 5/6 bot y4l);
  562.  filldraw stroke z1e{up}....{left}z2e;  % upper arc
  563.  filldraw stroke z7e{left}....{x8-x7,5(y8-y7)}z8e;  % lower arc
  564.  path upper_arc, lower_arc;
  565.  upper_arc=z1{up}....{left}z2; lower_arc=z7{left}....{x8-x7,5(y8-y7)}z8;
  566.  pos10(.3[fine.breadth,cap_hair],0); pos9(.3[fine.breadth,cap_hair],0);
  567.  x10r=x1l; top y10=top y2l; x9l=x8r; bot y9=bot y7r;
  568.  x1l-x1'=x8'-x8r=1.6cap_curve-fine; y1'=y1; y8'=y8;
  569.  numeric t; t=xpart(upper_arc intersectiontimes(z10l--z1'));
  570.  filldraw z1l--z10r--z10l--subpath(t,0) of upper_arc--cycle;  % upper barb
  571.  t:=xpart(lower_arc intersectiontimes(z9r--z8'));
  572.  filldraw z8r--z9l--z9r--subpath(t,1) of lower_arc--cycle;  % lower barb
  573. else: pos1(4/7[s_slab,flare],-100); pos8(flare,-100);
  574.  x1l=good.x(x1l+w-u-rt x1); lft x8r=hround .5u;
  575.  top y1l=vround(.93h+1.5oo); bot y8r=vround .1h-oo;
  576.  filldraw stroke term.e(2,1,right,.9,4);  % upper arc and terminal
  577.  filldraw stroke term.e(7,8,left,1,4); fi  % lower arc and terminal
  578. penlabels(0,1,1',2,3,4,5,6,7,8,8',9,10); endchar;
  579.  
  580. ecchar "The letter t";
  581. beginchar("t",6u#+max(u#,.5stem#),
  582.  min(asc_height#,if hefty:9/7 else:10/7 fi\\ x_height#),0);
  583. italcorr x_height#*slant if serifs: -.9u# else: -.4u# fi;
  584. adjust_fit(0,if serifs: 0 else: -.5u# fi);
  585. numeric shaved_stem; shaved_stem=hround(stem if hefty:-\\2stem_corr fi);
  586. pickup fine.nib; pos2(shaved_stem,180);pos3(shaved_stem,180);
  587. lft x2r=lft x3r=hround(2.5u-.5shaved_stem);
  588. y2=y8; y3=max(.5bar_height,2vair);
  589. pickup crisp.nib; pos8(bar,90);
  590. rt x8=hround(w-1.3u); top y8r=x_height; lft x7=hround 1/3u; y7l=y8l;
  591. if hefty: pos7(bar,90);
  592.  filldraw stroke z7e--z8e;  % crossbar
  593.  pickup tiny.nib; pos1(hround(shaved_stem-stem_corr),0);
  594.  rt x1r=fine.rt x2l; top y1=h;
  595.  penpos2'(x1r-x1l,0); x2'=x1; y2'=y2;
  596.  filldraw stroke z1e--z2'e;  % upper terminal
  597. else: pos7(vair,90); pos1(hair,0);
  598.  rt x1r=fine.rt x2l; top y1=h;
  599.  filldraw z1l{down}...{left}z7r--z7l--z8l
  600.   --z8r--(x1r,y8r)--z1r--cycle; fi  % upper terminal and crossbar
  601. pickup fine.nib; interim superness:=more_super;
  602. pos4(vair',-90); bot y4r=-oo; rt x5r=hround(w-u);
  603. if serifs: pos5(hair,0); y5=y3; x4l=.5[x3l,x5l];
  604.  (x,y4r)=whatever[z4l,z5l]; x4r:=max(x,.5[x3r,x4]);
  605.  filldraw stroke z2e..super_arc.e(3,4)...{up}z5e;  % stem and hook
  606.  pickup crisp.nib; pos6(hair,0); pos5'(hair,0);
  607.  x6=x5=x5'; top y6=max(vround .75bar_height,top y5); y5=y5';
  608.  filldraw stroke z5'e--z6e;  % terminal
  609. else: pos5(vair,-75); top y5l=vround .2[top y4l,bar_height];
  610.  x5l:=good.x x5l; x4l=1/3[x3l,x5l]; x4r:=1/3[x3r,x5r]; y3l:=y3l+.2vair;
  611.  filldraw stroke z2e..super_arc.e(3,4);  % stem and hook
  612.  path p; p=stroke z4e{right}..tension .9 and atleast 1..z5e;  % terminal
  613.  if (xpart(z5l-precontrol 1 of p)<0) or (xpart(z5r-postcontrol 2 of p)<0):
  614.   filldraw stroke z4e{right}...{up}z5e;
  615.  else: filldraw p; fi fi;
  616. penlabels(1,2,3,4,5,6,7,8); endchar;
  617.  
  618. ecchar "The letter u";
  619. beginchar("u",10u#,x_height#,0);
  620. italcorr x_height#*slant-serif_fit#+.5stem#-2u#;
  621. adjust_fit(serif_fit#+stem_shift#,serif_fit#-stem_shift#);
  622. numeric light_vair; light_vair=vair if hefty: -vround 2vair_corr fi;
  623. if light_vair<fine.breadth: light_vair:=fine.breadth; fi
  624. pickup tiny.nib; pos1(stem,0); pos2(stem,0);
  625. pos3(stem,0); pos4(stem',0);
  626. lft x1l=hround(2.5u-.5stem); x1=x2; x3=w-x1; x3r=x4r;
  627. if serifs: top y1=h+min(oo,serif_drop); bot y4=-min(oo,serif_drop);
  628. else: top y1=h; bot y4=0; fi
  629. pos0(stem,0); pos0'(stem',0); x0=x3; x0'=x4; y0=y0';
  630. penpos2'(stem-fine,-180); z2'=z2; y3=y1; y2=.5bar_height;
  631. penpos5(max(eps,light_vair-fine),-90); penpos6(thin_join-fine,0);
  632. y6=y0=2/3bar_height;
  633. filldraw stroke z1e--z2e;  % left stem
  634. filldraw stroke z3e..z0e--z0'e..z4e;  % right stem
  635. pickup fine.nib; bot y5r=-oo; x5l=.5w-.25u; lft x6l=tiny.lft x0l;
  636. (x,y5r)=whatever[z5l,z6l]; x5r:=max(x,.5[x5,x2'r]);
  637. filldraw stroke {{interim superness:=hein_super;
  638.   pulled_arc.e(2',5)}} & z5e{right}...{up}z6e;  % arc
  639. if serifs: sloped_serif.l(1,2,a,1/3,jut,serif_drop); % upper left serif
  640.  sloped_serif.l(3,0,b,1/3,jut,serif_drop); % upper right serif
  641.  sloped_serif.r(4,0',c,1/3,jut,min(oo,serif_drop)); fi % lower right serif
  642. penlabels(1,2,3,4,5); labels(6); endchar;
  643.  
  644. ecchar "The letter v";
  645. beginchar("v",if serifs: 9.5u# else:9u# fi,x_height#,0);
  646. italcorr x_height#*slant+.25u#;
  647. adjust_fit(serif_fit# if monospace:+\\.5u#,.5u#+ else:,fi\\ serif_fit#);
  648. numeric left_stem,right_stem,outer_jut,alpha;
  649. left_stem=fudged.stem-stem_corr;
  650. right_stem=min(fudged.hair if hefty:-2stem_corr fi,left_stem);
  651. outer_jut=.75jut; x1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4=h;
  652. x2-x1=x4-x3; x2l+apex_corr=x3l; y2=y3=-apex_oo;
  653. alpha=diag_ratio(2,right_stem,y1-y2,x4r-x1l-apex_corr);
  654. penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
  655. penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
  656. z0=whatever[z1r,z2r]=whatever[z3l,z4l];
  657. if y0>notch_cut: y0:=notch_cut;
  658.   fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
  659.     --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
  660.     ...{down}z0+.5left--cycle; % left and right diagonals
  661. else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
  662.     --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
  663. if serifs: numeric inner_jut; pickup tiny.nib;
  664.  prime_points_inside(1,2); prime_points_inside(4,3);
  665.  if rt x1'r+jut+.5u+1<=lft x4'l-jut: inner_jut=jut;
  666.  else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
  667.  dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut);  % left serif
  668.  dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); fi  % right serif
  669. penlabels(0,1,2,3,4); endchar;
  670.  
  671. ecchar "The letter w";
  672. beginchar("w",13u#,x_height#,0);
  673. italcorr x_height#*slant+.25u#;
  674. adjust_fit(serif_fit#,serif_fit#);
  675. numeric stem[],outer_jut,upper_notch,alpha,mid_corr;
  676. outer_jut=.7jut; x1l=w-x8r=l+letter_fit+outer_jut+.25u;
  677. stem1=fudged.stem-stem_corr;
  678. stem4=min(fudged.hair if hefty:-2stem_corr fi,stem1);
  679. stem2=if hefty:.1[vair,stem4] else: stem4 fi;
  680. stem3=max(stem2,stem1-3stem_corr);
  681. x2-x1=x4-x3=x6-x5=x8-x7; x2l+apex_corr=x3l; x6l+apex_corr=x7l;
  682. y1=y8=h; y2=y3=y6=y7=-apex_oo;
  683. y4=y5=if monospace: vround .6 fi\\ h; upper_notch=y4-notch_cut;
  684. mid_corr=if monospace or hefty:-.3apex_corr else: .5jut fi;
  685. alpha=diag_ratio(4,stem2-stem3+stem4,y1-y2,x8r-x1l+mid_corr-2apex_corr);
  686. penpos1(alpha*stem1,0); penpos2(alpha*stem1,0);
  687. penpos3(alpha*stem2,0); penpos4(alpha*stem2,0);
  688. penpos5(alpha*stem3,0); penpos6(alpha*stem3,0);
  689. penpos7(alpha*stem4,0); penpos8(alpha*stem4,0);
  690. x4l-x1l=floor(x4l-x1l+.5(x5r+mid_corr-x4r)); % |x5r| $\approx$ |x4r+mid_corr|
  691. z23=whatever[z1r,z2r]=whatever[z3l,z4l];
  692. z45=whatever[z3r,z4r]=whatever[z5l,z6l];
  693. z67=whatever[z5r,z6r]=whatever[z7l,z8l];
  694. fill diag_end(1l,2l,1,1,3r,4r){z4-z3}
  695.  ...if y45<upper_notch:(x45,upper_notch)+.5left{up}
  696.    --(x45,upper_notch)+.5right{down} else: z45&z45 fi
  697.  ...{z6-z5}diag_end(5l,6l,1,1,7r,8r)--diag_end(7r,8r,1,1,8l,7l){z7-z8}
  698.  ...if y67>notch_cut:(x67,notch_cut)+.5right{down}
  699.    --(x67,notch_cut)+.5left{up} else: z67&z67 fi
  700.  ...{z5-z6}special_diag_end(6,5,4,3){z3-z4}
  701.  ...if y23>notch_cut:(x23,notch_cut)+.5right{down}
  702.    --(x23,notch_cut)+.5left{up} else: z23&z23 fi
  703.  ...{z1-z2}diag_end(2r,1r,1,1,1l,2l)--cycle;  % diagonals
  704. if serifs: numeric inner_jut[]; pickup tiny.nib;
  705.  prime_points_inside(1,2); prime_points_inside(5,6); prime_points_inside(8,7);
  706.  if monospace: inner_jut1=inner_jut4=1.5jut;
  707.  elseif hefty: inner_jut1=inner_jut4=jut;
  708.  else: fill diag_end(6r,5r,1,1,5l,6l)--.9[z5l,z6l]
  709.    ..{z5-z6}.1[z5r,z6r]--cycle; % middle stem
  710.   inner_jut2=.7inner_jut1; inner_jut4=1.1inner_jut3;
  711.   if rt x1'r+jut+.5u+1<=lft x5'l-.7jut: inner_jut1=jut;
  712.   else: rt x1'r+inner_jut1+.5u+1=lft x5'l-inner_jut2; fi
  713.   if rt x5'r+jut+.5u+1<=lft x8'l-1.1jut: inner_jut3=jut;
  714.   else: rt x5'r+inner_jut3+.5u+1=lft x8'l-inner_jut4; fi
  715.   dish_serif(5',6,e,1/3,inner_jut2,f,1/2,inner_jut3); fi  % middle serif
  716.  dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut1);  % left serif
  717.  dish_serif(8',7,c,.6,inner_jut4,d,1/2,outer_jut)(dark); fi  % right serif
  718. penlabels(0,1,2,3,4,5,6,7,8,23,45,67); endchar;
  719.  
  720. ecchar "The letter x";
  721. beginchar("x",if serifs:9.5u# else:9u# fi,x_height#,0);
  722. italcorr x_height#*slant-.05u#;
  723. adjust_fit(serif_fit# if monospace:+\\.5u#,.5u#+ else:,fi\\ serif_fit#);
  724. numeric stem[],outer_jut,xjut,alpha[];
  725. stem1=fudged.stem-4stem_corr; stem2=min(fudged.hair,stem1);
  726. outer_jut=.75jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
  727. x1l=l+letter_fit+.1u+outer_jut; x2r=r-letter_fit-.3u-outer_jut-xjut;
  728. x3l=l+letter_fit+outer_jut+xjut; x4r=r-letter_fit-outer_jut;
  729. y1=y2=h; y3=y4=0;
  730. alpha1=diag_ratio(1,stem1,h,x4r-x1l);
  731. alpha2=diag_ratio(1,stem2,h,x2r-x3l);
  732. penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0);
  733. penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0);
  734. if hefty: z0=whatever[z1,z4]=whatever[z2,z3];
  735.  x12=x34=x0; y13=y24=y0;
  736.  z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l];
  737.  z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r];
  738.  forsuffixes $=13,24,34: z$'=.2[z$,z0]; endfor
  739.  fill diag_end(12,1r,.5,1,1l,13')--z13'--diag_end(13',3l,1,.5,3r,34')--z34'
  740.   --diag_end(34',4l,.5,1,4r,24')--z24'
  741.   --diag_end(24',2r,1,.5,2l,12)--z12--cycle; % diagonals
  742. else: fill diag_end(4r,1r,.5,1,1l,4l)
  743.   --diag_end(1l,4l,.5,1,4r,1r)--cycle; % left diagonal
  744.  fill diag_end(2l,3l,.5,1,3r,2r)
  745.   --diag_end(3r,2r,.5,1,2l,3l)--cycle; fi  % right diagonal
  746. if serifs: numeric inner_jut[]; pickup tiny.nib;
  747.  prime_points_inside(1,4); prime_points_inside(2,3);
  748.  prime_points_inside(3,2); prime_points_inside(4,1);
  749.  if rt x1'r+jut+.5u+1<=lft x2'l-jut-xjut: inner_jut1=jut;
  750.  else: rt x1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi
  751.  if rt x3'r+jut+.5u+1<=lft x4'l-jut-xjut: inner_jut2=jut;
  752.  else: rt x3'r+inner_jut2+.5u+1=lft x4'l-inner_jut2-xjut; fi
  753.  dish_serif(1',4,a,1/3,outer_jut,b,2/3,inner_jut1);  % upper left serif
  754.  dish_serif(4',1,c,2/3,inner_jut2,d,1/3,outer_jut);  % lower right serif
  755.  dish_serif(2',3,e,2/3,inner_jut1+xjut,
  756.   f,1/2,outer_jut+xjut)(dark);  % upper right serif
  757.  dish_serif(3',2,g,1/2,outer_jut+xjut,
  758.   h,2/3,inner_jut2+xjut)(dark); fi  % lower left serif
  759. penlabels(0,1,2,3,4,12,13,24,34); endchar;
  760.  
  761. ecchar "The letter y";
  762. beginchar("y",if serifs:9.5u# else:9u# fi,x_height#,desc_depth#);
  763. italcorr x_height#*slant+.25u#;
  764. adjust_fit(serif_fit# if monospace:+\\.5u#,.5u#+ else:,fi\\ serif_fit#);
  765. numeric left_stem,right_stem,bot_stem,bot_vair,outer_jut;
  766. left_stem=fudged.stem-stem_corr;
  767. right_stem=fudged.hair if hefty:-2stem_corr fi;
  768. bot_stem=fudged.hair if hefty:-8stem_corr fi;
  769. bot_vair=Vround(if serifs: vair else:.5[vair,bot_stem] fi);
  770. outer_jut=.75jut;
  771. x1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4r=h; y2=y3=0; x2l=x3l;
  772. numeric alpha,alpha[]; x9=3u; y9=bot_vair-d-oo;
  773. alpha1=diag_ratio(2,bot_stem,y1-y3,x4r-x1l-apex_corr);
  774. alpha2=diag_ratio(1,bot_stem,y1-y9,x4r-x9);
  775. if alpha1<alpha2: x2l-x1l=x4r-x3r+apex_corr; alpha=alpha1;
  776. else: alpha=alpha2; z3l=whatever[z9,z4r-(alpha*bot_stem,0)]; fi
  777. penpos3(alpha*bot_stem,0); penpos4(alpha*right_stem,0);
  778. alpha3=(y1++(x2l-x1l))/y1;
  779. penpos1(alpha3*left_stem,0); penpos2(alpha3*left_stem,0);
  780. z0=whatever[z1r,z2r]=z4l+whatever*(z3r-z4r);
  781. if y0>notch_cut: y0:=notch_cut;
  782.   fill z0+.5right{up}...{z4r-z3r}diag_end(0,4l,1,1,4r,3r)
  783.     --z3r--z2l--diag_end(2l,1l,1,1,1r,2r){z2-z1}
  784.     ...{down}z0+.5left--cycle; % left and right diagonals
  785. else: fill z0--diag_end(0,4l,1,1,4r,3r)--z3r--z2l
  786.     --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
  787. penpos5(alpha*bot_stem,0); z5r=whatever[z3r,z4r]; y5-.5vair=-.5d;
  788. if serifs: numeric light_bulb; light_bulb=hround 7/8[hair,flare]; clearpen;
  789.  penpos6(vair,-90); penpos7(hair,-180); penpos8(light_bulb,-180);
  790.  x6=2u; y6r=-d-oo; y8-.5light_bulb=-.85d; x8r=hround .35u;
  791.  fill stroke z3e---z5e...{left}z6e; bulb(6,7,8);  % arc and bulb
  792.  numeric inner_jut; pickup tiny.nib;
  793.  prime_points_inside(1,2); prime_points_inside(4,3);
  794.  if rt x1'r+jut+.5u+1<=lft x4'l-jut: inner_jut=jut;
  795.  else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
  796.  dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut);  % left serif
  797.  dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark);  % right serif
  798. else: penpos6(bot_vair,-90); x6=2.5u; y6r=-d-oo;
  799.  fill stroke z3e---z5e...{left}z6e;  % arc
  800.  pickup fine.nib; pos6'(bot_vair,-90); z6'=z6;
  801.  pos7(2/3[bot_vair,flare],-85);
  802.  lft x7l=hround u; bot y7r=vround-.96d-oo; y7l:=good.y y7l;
  803.  filldraw stroke term.e(6',7,left,1,4); fi % arc and terminal
  804. penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
  805.  
  806. ecchar "The letter z";
  807. beginchar("z",8u#,x_height#,0);
  808. italcorr x_height#*slant-.5serif_fit#-.3u#;
  809. adjust_fit(0,.5serif_fit#);
  810. numeric arm_thickness[],z_stem;
  811. if hefty: arm_thickness1=Vround(vair-vair_corr); arm_thickness2=vair;
  812.  z_stem=.6[vair,stem];
  813. else: arm_thickness1=vair; arm_thickness2=vair'; z_stem=.9[vair,stem]; fi
  814. pickup tiny.nib; rt x1r=rt x2r=hround(w-.8u); lft x3l=lft x4l=hround .5u;
  815. top y1=h; y2=min(y1,h-2/3arm_thickness1);
  816. bot y4=0; y3=max(y4,2/3arm_thickness2);
  817. numeric alpha; alpha=diag_ratio(1,z_stem-tiny,y2-y3,x2r-x3l-slant*(y2-y3));
  818. penpos1(alpha*(z_stem-tiny),0); penpos2(alpha*(z_stem-tiny),0);
  819. penpos3(alpha*(z_stem-tiny),0); penpos4(alpha*(z_stem-tiny),0);
  820. pair delta; delta=penoffset z3-z2 of currentpen;
  821. fill top lft z1l--z2l+delta---z3l+delta..lft z3l---lft z4l..bot z4l
  822.  ---bot rt z4r--z3r-delta---z2r-delta..rt z2r---rt z1r..top z1r
  823.  ---cycle;  % diagonal
  824. pickup crisp.nib; pos5(arm_thickness1,90); pos6(hair,180);
  825. top y5r=h; x5=x1; lft x6r=hround .75u; y6=good.y(y5l-beak/1.4)-eps;
  826. arm(5,6,a,beak_darkness,-.4beak_jut);  % upper arm and beak
  827. pos7(arm_thickness2,-90); pos8(hair,0);
  828. bot y7r=0; x7=x4; rt x8r=hround(w-.75u); y8=good.y(y7l+beak/1.2)+eps;
  829. arm(7,8,b,beak_darkness,.6beak_jut);  % lower arm and beak
  830. penlabels(1,2,3,4,5,6,7,8); endchar;
  831.  
  832.  
  833. endinput;
  834.